<template>
    <el-tabs :tab-position="tabPosition" @tab-change="onChange">
        <el-tab-pane v-for="item in scheduleType" :key="item.id" :label="item.title">
            
        </el-tab-pane>
    </el-tabs>
</template>

<script lang="ts" setup>
import { TabsInstance } from 'element-plus';
import { ref,onMounted } from 'vue'
const tabPosition = ref<TabsInstance['tabPosition']>('top')
const form = ref<any>({search:'',schedule_id:0})
interface scheduleType {
    id: number
    title: string
}
interface info {
    id: number
    title: string
    project_id:number
    brief: string
    created_at: string
    start_date: string
    end_date: string
    status: string
}

const tableData = ref<info[]>([])
const scheduleType = ref<scheduleType[]>([
    {id:1,title:'进度一'},
    {id:2,title:'进度二'},
    {id:3,title:'进度三'},
    {id:4,title:'进度四进度四进度四进度四进度四'}
])

const onGetData = () => {
    console.log('请求')
    form.value.page = 0;
    form.value.loading = true
    tableData.value = [
        {id:1,title:'项目嗷嗷',brief:'',project_id:20,created_at:'',start_date:'',end_date:'',status:''},
        {id:2,title:'项目嗷嗷',brief:'',project_id:0,created_at:'2011-11-12',start_date:'2031-12-20',end_date:'2033-10-05',status:''},
        {id:3,title:'项目嗷嗷',brief:'',project_id:0,created_at:'',start_date:'',end_date:'',status:''},
        {id:4,title:'项目嗷嗷',brief:'',project_id:0,created_at:'',start_date:'',end_date:'',status:''},
        {id:5,title:'项目嗷嗷',brief:'',project_id:0,created_at:'',start_date:'',end_date:'',status:''},
        {id:6,title:'项目嗷嗷',brief:'',project_id:0,created_at:'',start_date:'',end_date:'',status:''},
    ]
    form.value.loading = false
    // form.value.loading = true
    // http.post('/Disclosure',form.value).then((response:any)=>{
    //     form.value.loading = false
    //     tableData.value = response.data.data
    //     form.value.total = response.data.total
    // })
}

const onChange = (index:number) => {
    form.value.schedule_id =  scheduleType.value[index].id
    console.log(form.value.schedule_id)
}

onMounted(()=>{
    onGetData()
})

</script>

<style scoped>

</style>